package com.supor.aiot.home.helper;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.supor.aiot.home.ui.device.config.WlanDescriptionActivity;

/**
 * Description :
 * 关闭wlan+说明
 * @author jyt
 * @date 2021/5/21
 */
public class WlanDescriptionSpan extends ClickableSpan {
    private String text;
    private String deviceBrand;
    private Context mcontext;
    public WlanDescriptionSpan(String text, String deviceBrand, Activity activity) {
        this.text = text;
        this.deviceBrand = deviceBrand;
        this.mcontext = activity;
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        intent.setClass(mcontext, WlanDescriptionActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mcontext.startActivity(intent);
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        super.updateDrawState(ds);
        ds.setColor(Color.parseColor("#16BF86"));
        ds.setUnderlineText(false);
    }

}
